﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class EndTip : MonoBehaviour 
{

    void Awake()
    {
        gameObject.SetActive(false);
    }
    public void ShowTip(string tipWords)
    {
        GetComponent<Text>().text = tipWords;
        gameObject.SetActive(true);
        GetComponent<TypewriterEffect>().OnStart();
        PlayReadVoice(tipWords);
       
    }



    void PlayReadVoice(string tipWords)
    {
        switch (tipWords)
        {
            case TipWords.game0_jiaoshoujiaTip:
                SoundManager.instance.Play("jiaoshoujia");
                break;
            case TipWords.game1_wutidaji:
                SoundManager.instance.Play("wutidaji");
                break;
            default:
                Debug.Log("没有这个声音");
                break;
        }
        
    }
}
